package org.bookie.model.services.impl;

import org.bookie.model.Group;
import org.bookie.model.services.GroupDAO;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

public class HibernateGroupDAO extends GenericHibernateDAO<Group, Long> implements GroupDAO {

	public Group findByName(String name) {
		Criteria crit = getSession().createCriteria(getPersistentClass());
		return (Group) crit.add(Restrictions.eq("name", name)).uniqueResult();
	}

}
